#!/bin/bash
#nginx初始化
PP2=`cat -n /usr/local/nginx/conf/fastcgi.conf  | grep open_basedir=  | awk '{print $1}'`
sed -i  ''"$PP2"'s/^/#/'  /usr/local/nginx/conf/fastcgi.conf

##替换nginx主配置文件
cd /usr/local/nginx/conf/
mv nginx.conf  nginx.conf-bak
cd ${PD}/conf/nginx
cp nginx.conf  /usr/local/nginx/conf/

mkdir /usr/local/nginx/conf/vhost/default
cd ${PD}/conf/nginx/vhost
cp admin.conf  app.conf    web  /usr/local/nginx/conf/vhost/default
cp  fzr  /usr/local/nginx/conf/vhost


#隐藏版本号
NGYH=`cat -n /usr/local/nginx/conf/fastcgi.conf  | grep '$nginx_version' | awk '{print $1}'`
sed -i ''"$NGYH"'c  fastcgi_param SERVER_SOFTWARE nginx;'  /usr/local/nginx/conf/fastcgi.conf